﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region Using
using System;
using System.Collections.Generic;
using System.ServiceModel.DomainServices.Server;
using NetBay.Core.BusinessEntities;
using Rio.Doc.Business.Repository;
using Rio.Applications.Web.Services.BusinessEntities;
using System.Xml;
using System.IO;
using System.Linq;
using Rio.Applications.Web.RioWCFServices;
using Rio.Applications.Web.Helpers;
using Rio.Framework.RioManager;
using System.Configuration;
using NetBay.Core.BusinessEntities.AdvancedSearchCriteria;
using NetBay.Core.Tools;
using NetBay.Core.BusinessEntities.Workflow;
#endregion

namespace Rio.Applications.Web.Services
{
    public partial class BusinessEntitiesDomainService : DomainService
    {
        /// <summary>
        /// Get the number of user declared
        /// </summary>
        /// <returns>Get the number of user declared in RioGed</returns>
        [Query(HasSideEffects = true)]
        public IEnumerable<ReturnLong> GetNbUserDeclared()
        {
            List<ReturnLong> l_oReturnLongs = new List<ReturnLong>();

            try
            {

                // Get the Current user
                ReturnLong l_oReturnLong = UserRepository.GetNbUserDeclared();

                l_oReturnLongs.Add(l_oReturnLong);
            }
            catch ( Exception ex )
            {
                ReturnLong l_oReturnLong = new ReturnLong("()", ex);
                l_oReturnLongs.Add(l_oReturnLong);
            }

            return l_oReturnLongs;
        }

        /// <summary>
        /// Get the number of document indexed
        /// </summary>
        /// <returns>the number of document added in RioGed</returns>
         [Query(HasSideEffects = true)]
        public IEnumerable<ReturnLong> GetNbDocument()
        {
            List<ReturnLong> l_oReturnLongs = new List<ReturnLong>();

            try
            {
                // Get the Current user
                ReturnLong l_oReturnLong = DocumentRepository.GetNbDocument();

                l_oReturnLongs.Add(l_oReturnLong);
            }
            catch ( Exception ex )
            {
                ReturnLong l_oReturnLong = new ReturnLong("()", ex);
                l_oReturnLongs.Add(l_oReturnLong);
            }

            return l_oReturnLongs;
        }

    }
}